{% extends "template.html" %}

{% block conteudo %}
<form method="post" action="/DisciplinaRelacionada/{{ id }}/Incluir/" >

		{% csrf_token %}
		<div class='formulario'>
			{{ form.disciplinaRelacionada.label }}:{{form.disciplinaRelacionada}} 
			{{ form.prerequisito }} {{ form.prerequisito.label }}
			<input type=image src="{{ MEDIA_URL }}images/mais.png" width="20" height="20"> 
			{{ form.errors }}
		</div>
</form>

<form action="/DisciplinaRelacionada/" method="post">
	{% if erro %}
		{{ erro }}
	{% endif %}
	<table border="0" id="dr" width="100%" >
		<tbody>
			<th colspan="3">
				Disciplinas Relacionadas
			</th>		
			{% if erroLista %}
			 	<tr class="{{ classetr }}">
			 	 <td colspan="3" >
					{{ erroLista }}
					</td>
				</tr>
			{% endif %}
			{% for dr in drs %}
			{% cycle 'odd' 'even' as classetr silent %}        
            <tr class="{{ classetr }}">
            	<td>
					{{ dr.Disciplina }}
				</td>
				<td>
					{% if dr.PreRequisito %}
						Pre-requisito
					{% else %}
						Requisito Paralelo
				{% endif %}
				</td>
				<td>
					<a href="/DisciplinaRelacionada/{{id}}/Excluir/{{ dr.id }}"><img src="{{ MEDIA_URL }}images/lixeira.png" width="20" height="20"/></a>	
				</td>
				</tr>
				{% endfor %}
		</tbody>
	</table>
</form>
<div class='navegacao'>
	<input type="submit" value="Voltar" onclick="location. href= '/PlanoEnsino/' ">
	<input type="submit" value="Proximo" onclick="location. href= '/Competencia/{{id}}' ">
</div>
{% endblock %}